// JavaScript Document
var date;

	$(function(){
		date = new Date();
		show(date);	
		$('#upMonth').click(function(){
			var month = date.getMonth();
			if(month>0){
				date.setMonth(month-1);
			}else{
				date.setYear(date.getFullYear()-1);
				date.setMonth(11);	
			}
			show(date);
		});
		
		$('#botmMonth').click(function(){
			var month = date.getMonth();
			if(month<11){
				date.setMonth(month+1);
			}else{
				date.setYear(date.getFullYear()+1);
				date.setMonth(0);	
			}
			show(date);
		});
		
	});


	<!-- 根据时间显示日历-->
	function show(date){
		$('#days').html('');
		$('#now_month').html(date.getFullYear()+'年'+(1+date.getMonth())+'月');
		var days = getDays(date);
		var ndate = date;
		ndate.setDate(1);
		
		for(var i=0;i<ndate.getDay();i++){
			$('#days').append(' <div class="nday">&nbsp;</div>');
		}
		
		for(var i=1;i<=days;i++){
			var ys = ndate.getDay()+i-1;
			if(ys%7==0){
				$('#days').append(' <div class="day weekDay" id="'+i+'" title="新增个人日程"><span class="gongli">'+i+'</span><span class="nongli">'+GetLunarDay(date.getFullYear(), date.getMonth()+1, i)+'</span> <span class="shixiang">&nbsp;</span> </div>');
			}else{
				$('#days').append(' <div class="day" id="'+i+'" title="新增个人日程" ><span class="gongli">'+i+'</span><span class="nongli">'+GetLunarDay(date.getFullYear(), date.getMonth()+1, i)+'</span> <span class="shixiang">&nbsp;</span> </div>');
			}
		}
		
		<!--双击事件-->
		$('#days .day').dblclick(function(){
			<!--location.href='http://www.baidu.com/s?wd='+(date.getFullYear()+1900)+'年'+(date.getMonth()+1)+'月'+this.id+'日';-->
			<!--window.open('http://www.baidu.com/s?wd='+(date.getFullYear())+'年'+(date.getMonth()+1)+'月'+this.id+'日','哈哈');-->
		});
		
		<!-- 右击时间-->
		$('.day').contextmenu(function(){
			$('#contextMenu').css('left',event.clientX).css('top',event.clientY);	
			$('#contextMenu').show(200);
			$('#selectDay').val(this.id);
			return false;
		});
		
		$('.day').mouseover(function(){
			$('#contextMenu').hide(200);
		});
		
	}
	
	
	<!-- 根据日期获取本月总天数-->
	function getDays(date){
		var month = date.getMonth()+1;
		var year = date.getFullYear();
		if(year<200){
			year=year+1900;
		}
		if(month==2){
			if(isRun(year)){
				return 29;
			}else{
				return 28;
			}
		}else if(month==4 || month==6 || month==9 || month==11){
			return 30;
		}else{
			return 31;	
		}
	}
	
	<!-- 判断是否闰年-->
	function isRun(year){
		var run = false;
		if((year%100==0 && year%400==0) || year%4==0){
			run = true;
		}
		return run;
	}